package com.yboot.module.system.model.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yboot.starter.common.core.web.validation.InsertGroup;
import com.yboot.starter.common.core.web.validation.UpdateGroup;
import com.yboot.starter.mybatis.core.base.entity.BaseEntity;

import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * 消息表
 * @author yangcs
 * @date 2025-08-29
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("sys_message")
public class SysMessageEntity extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @NotBlank(message = "id不能为空", groups = {UpdateGroup.class})
    private String id;
    /**
     * 标题
     */
    @NotBlank(message = "title不能为空", groups = {InsertGroup.class, UpdateGroup.class})
    private String title;
    /**
     * 内容
     */
    private String content;
    /**
     * 类型（1：系统消息；2：安全消息）
     */
    @NotBlank(message = "type不能为空", groups = {InsertGroup.class, UpdateGroup.class})
    private String type;
    /**
     * 跳转路径
     */
    private String path;
    /**
     * 通知范围（1：所有人；2：指定用户）
     */
    @NotBlank(message = "scope不能为空", groups = {InsertGroup.class, UpdateGroup.class})
    private String scope;
    /**
     * 通知用户
     */
    private String users;
}
